package com.kai;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @Author Mr.Yan
 * @create 2022/3/29 12:34
 * @description:
 */
public class InputStreamTest {
    public static void main(String[] args) {
        ClassLoader classLoader = InputStreamTest.class.getClassLoader();
        try(InputStream inputStream=classLoader.getResourceAsStream("a.txt")) {
            FileOutputStream stream = new FileOutputStream("src//b.txt");
            inputStream.transferTo(stream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
